<?php
/**
 *
 * @Filename index.php $
 *
 * @Author nikm $
 *
 * @Date 2011-3-13 $
 */

//error_reporting(E_ERROR);
error_reporting(E_ALL|E_NOTICE);
ini_set('display_errors', 'on');

define('FROM_INDEX', true);
define('ROOT_PATH', dirname(__FILE__).'/');

require ROOT_PATH.'include/lib/load_setting.php';
load_setting('site_setting');
@header('Content-Type: text/html; charset='.CHARSET);

require ROOT_PATH.'include/function/global.func.php';

session_start();

$request = $_REQUEST;

// Available modules
$mods = array('index'=>1, 'login'=>1, 'business'=>1, 'business_special'=>1, 
			'customer_comment'=>1, 'customer_complaint'=>1, 
			'seafood'=>1, 'seafood_recommend'=>1,
			'hostel'=>1, 'hostel_room'=>1, 'hostel_comment'=>1,
			'scenic'=>1, 'scenic_comment'=>1,
			'shop'=>1, 'shop_item'=>1 ,'shop_comment'=>1,
			'credit_list'=>1, 'gov_price'=>1, 'complaint_deal'=>1, 'news'=>1,
			'tips'=>1, 'food_culture'=>1,
			'user'=>1, 'visitor'=>1, 'cache'=>1, 'setting'=>1);

$mod = isset($request['m']) ? $request['m'] : '';

if(!isset($mods[$mod]))
{
	$mod = 'index';
	$request['m']= $mod;
}

$mod_file = ROOT_PATH.'module/admin/'.$mod.'.mod.php';

// Module does not exists
if(!file_exists($mod_file))
{
	include ROOT_PATH.'include/error_404.php';
	exit;
}

require $mod_file;
$module = new moduleObj($request);